home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
tcoop10a.zip
/
DOC.ZIP
/
POINT.DOC
< prev
next >
Wrap
Text File
|
1991-11-20
|
3KB
|
80 lines
POINT.DOC 11/15/91 Copyright (c) 1991 by James S. Clark
==========================================================================
POINT
Point Class
--------------------------------------------------------------------------
Class Name Point
Superclass <none>
Category Graphics
Other classes referenced <none>
Other catagories referenced <none>
Used by Mgraphic
Inherited by <none>
Declaration Point *p = new Point(x, y);
Instance Variables
int x, y;
Instance Methods
Point () { x = 0; y = 0; };
Point (int nx, int ny) { x = nx; y = ny; };
int getx ();
int gety ();
void offset (int dx, int dy);
void set (int x, int y);
operators Point& operator = (const Point& p);
Point& operator + (const Point& p);
--------------------------------------------------------------------------
GENERAL DESCRIPTION
The Point Class provides a simple way of working with corrdinates. While
it is not used directly by the Graphic Class, it is in the Mgraphic Class,
which simplifies parameter passing when Mgraphics is used instead of the
Graphic Class for basic graphics functions.
Methods are provided for creation, and offsetting. Operators are
available for copying and adding points together.
--------------------------------------------------------------------------
VARIABLES
int x;
The x-axis coordinate of the point.
int y;
The y-axis coordinate of the point.
--------------------------------------------------------------------------
METHODS
Point () { x = 0; y = 0; };
Creates a point with both coordinates set to NULL.
Point (int nx, int ny) { x = nx; y = ny; };
Create a point with the coordinates set to x and y.
int getx ();
Returns the value of the x coordinate.
int gety ();
Returns the value of the y coordinate.
void offset (int dx, int dy);
Offsets the point by adding dx and dy to the coordinates.
void set (int x, int y);
Sets the value of the point to x and y.
Point& operator = (const Point& p);
Copies the the values of the point on the right side of the
sign into the point on the left side of the operator.
Point& operator + (const Point& p);
Adds the coordinates of the two points and leaves the result
in the point on the left side of the operator. Works the same
as the offset() method.
--------------------------------------------------------------------------
POINT.DOC Copyright (c) 1991 by James S. Clark
==========================================================================